<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <button>登录</button>
    </div>
    
    Alice 给 Cathy 转账 9999
    <form method="get" action="http://localhost:8000/transfer">
        <input type="hidden" name="from" value="Alice">
        <input type="hidden" name="money" value="9999">
        <input type="hidden" name="to" value="Cathy">
        <input type="button" onclick="submit()" value="转账">
    </form>

    <script>
        var btn = document.querySelector('button')
        btn.onclick = function () {
            var xhr = new XMLHttpRequest()
            xhr.open('GET', 'http://localhost:8000/login')
            xhr.send()
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4 && xhr.status === 200) {
                    console.log('登陆成功');
                }
            }
        }
    </script>
</body>
</html>